<!DOCTYPE html>
<html>
    <head>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
        <title>Google Maps JavaScript API v3 Example: Directions Complex</title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
        <script type="text/javascript">

            $(document).ready(function(){
                //var apiUrl ='http://en.wikipedia.org/w/api.php?format=json&action=query&list=search&=srlimit=80&srwhat=text&srsearch=uster&callback=?';
                var apiUrl = 'http://en.wikipedia.org/w/api.php?callback=?';
                /* var apiParams = {
                    format: "json",
                    action: "opensearch",
                    search: 'Uster',
                    callback: 'spellcheck'
                };*/
                var apiParams = {
                    format: "json",
                    action: "query",
                    list: "search",
                    srlimit: 1, // is this a good limit?
                    srwhat: "text",
                    srsearch: 'U'
                };

                $.getJSON(apiUrl, apiParams, function(data) {
                    if(data.query.searchinfo.totalhits != 0) {
                        var title = data.query.search[0].title;
                        var snippet = data.query.search[0].snippet;
                        alert(title + '\n' + snippet);
                        apiParams = {
                            format: "json",
                            action: "parse",
                            page: title
                        };
                        $.getJSON(apiUrl, apiParams, function(data) {
                            var match = data;
                        });
                    }
                });

            });
        </script>
    </head>
    <body>

    </body>
</html>
